/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.surveilans.classes;

import com.surveilans.model.UnitModel;
import java.util.Date;

/**
 *
 * @author Yudi Retanto
 */
public class DataSurveilans {
    private int id;
    private int id_unit;
    private int id_penyakit;
    private String nama_penyakit;
    private Date tanggal;
    private String tanggal_str;
    private int range1;
    private int range2;
    private int range3;
    private int range4;
    private int range5;
    private int range6;
    private int range7;
    private int range8;
    private int range9;
    private int range10;
    private int range11;
    private int range12;
    private int total;

    public DataSurveilans(int id,int id_unit, int id_penyakit, String nama_penyakit, Date tanggal, int range1, int range2, int range3, int range4, int range5, int range6, int range7, int range8, int range9, int range10, int range11, int range12) {
        this.id = id;
        this.id_unit = id_unit;
        this.id_penyakit = id_penyakit;
        this.nama_penyakit = nama_penyakit;
        this.tanggal = tanggal;
        this.range1 = range1;
        this.range2 = range2;
        this.range3 = range3;
        this.range4 = range4;
        this.range5 = range5;
        this.range6 = range6;
        this.range7 = range7;
        this.range8 = range8;
        this.range9 = range9;
        this.range10 = range10;
        this.range11 = range11;
        this.range12 = range12;
    }

    public DataSurveilans() {
        this.id = 0;
        this.id_unit = 0;
        this.id_penyakit = 0;
        this.nama_penyakit = "";
        this.tanggal = new Date();
        this.range1 = 0;
        this.range2 = 0;
        this.range3 = 0;
        this.range4 = 0;
        this.range5 = 0;
        this.range6 = 0;
        this.range7 = 0;
        this.range8 = 0;
        this.range9 = 0;
        this.range10 = 0;
        this.range11 = 0;
        this.range12 = 0;
        this.total = 0;
    }

    public int getId_penyakit() {
        return id_penyakit;
    }

    public void setId_penyakit(int id_penyakit) {
        this.id_penyakit = id_penyakit;
    }

    public int getId_unit() {
        return id_unit;
    }

    public void setId_unit(int id_unit) {
        this.id_unit = id_unit;
    }

    public String getNama_penyakit() {
        return nama_penyakit;
    }

    public void setNama_penyakit(String nama_penyakit) {
        this.nama_penyakit = nama_penyakit;
    }

    public int getRange1() {
        return range1;
    }

    public void setRange1(int range1) {
        this.range1 = range1;
    }

    public int getRange10() {
        return range10;
    }

    public void setRange10(int range10) {
        this.range10 = range10;
    }

    public int getRange11() {
        return range11;
    }

    public void setRange11(int range11) {
        this.range11 = range11;
    }

    public int getRange12() {
        return range12;
    }

    public void setRange12(int range12) {
        this.range12 = range12;
    }

    public int getRange2() {
        return range2;
    }

    public void setRange2(int range2) {
        this.range2 = range2;
    }

    public int getRange3() {
        return range3;
    }

    public void setRange3(int range3) {
        this.range3 = range3;
    }

    public int getRange4() {
        return range4;
    }

    public void setRange4(int range4) {
        this.range4 = range4;
    }

    public int getRange5() {
        return range5;
    }

    public void setRange5(int range5) {
        this.range5 = range5;
    }

    public int getRange6() {
        return range6;
    }

    public void setRange6(int range6) {
        this.range6 = range6;
    }

    public int getRange7() {
        return range7;
    }

    public void setRange7(int range7) {
        this.range7 = range7;
    }

    public int getRange8() {
        return range8;
    }

    public void setRange8(int range8) {
        this.range8 = range8;
    }

    public int getRange9() {
        return range9;
    }

    public void setRange9(int range9) {
        this.range9 = range9;
    }

    public Date getTanggal() {
        return tanggal;
    }

    public void setTanggal(Date tanggal) {
        this.tanggal = tanggal;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getTanggal_str() {
        return tanggal_str;
    }

    public void setTanggal_str(String tanggal_str) {
        this.tanggal_str = tanggal_str;
    }
    
    public void updateTotal() {
        this.total = this.range1+this.range2+this.range3+this.range4+this.range5+this.range6+this.range7+this.range8+this.range9+this.range10+this.range11+this.range12;
    }
    
    public int getIdKabupaten(){
        UnitModel unit = new UnitModel();
        return unit.getUnit(this.id_unit).getKabupaten();
    }
}
